/*
* Copyright 2025 NXP
* NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms.  If you do not agree to be bound by the applicable license
* terms, then you may not retain, install, activate or otherwise use the software.
*/

#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"



void setup_scr_screen_ctrl(lv_ui *ui)
{
    //Write codes screen_ctrl
    ui->screen_ctrl = lv_obj_create(NULL);
    lv_obj_set_size(ui->screen_ctrl, 240, 280);
    lv_obj_set_scrollbar_mode(ui->screen_ctrl, LV_SCROLLBAR_MODE_AUTO);

    //Write style for screen_ctrl, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->screen_ctrl, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_ctrl, lv_color_hex(0x0d0d0d), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->screen_ctrl, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes screen_ctrl_btn_flashlight
    ui->screen_ctrl_btn_flashlight = lv_btn_create(ui->screen_ctrl);
    ui->screen_ctrl_btn_flashlight_label = lv_label_create(ui->screen_ctrl_btn_flashlight);
    lv_label_set_text(ui->screen_ctrl_btn_flashlight_label, "");
    lv_label_set_long_mode(ui->screen_ctrl_btn_flashlight_label, LV_LABEL_LONG_WRAP);
    lv_obj_align(ui->screen_ctrl_btn_flashlight_label, LV_ALIGN_CENTER, 0, 0);
    lv_obj_set_style_pad_all(ui->screen_ctrl_btn_flashlight, 0, LV_STATE_DEFAULT);
    lv_obj_set_width(ui->screen_ctrl_btn_flashlight_label, LV_PCT(100));
    lv_obj_set_pos(ui->screen_ctrl_btn_flashlight, 20, 20);
    lv_obj_set_size(ui->screen_ctrl_btn_flashlight, 90, 90);

    //Write style for screen_ctrl_btn_flashlight, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->screen_ctrl_btn_flashlight, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_ctrl_btn_flashlight, lv_color_hex(0x444444), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->screen_ctrl_btn_flashlight, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(ui->screen_ctrl_btn_flashlight, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->screen_ctrl_btn_flashlight, 15, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->screen_ctrl_btn_flashlight, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_src(ui->screen_ctrl_btn_flashlight, &_sdt_90x90, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_opa(ui->screen_ctrl_btn_flashlight, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_recolor(ui->screen_ctrl_btn_flashlight, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_recolor_opa(ui->screen_ctrl_btn_flashlight, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->screen_ctrl_btn_flashlight, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->screen_ctrl_btn_flashlight, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->screen_ctrl_btn_flashlight, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->screen_ctrl_btn_flashlight, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes screen_ctrl_btn_set
    ui->screen_ctrl_btn_set = lv_btn_create(ui->screen_ctrl);
    ui->screen_ctrl_btn_set_label = lv_label_create(ui->screen_ctrl_btn_set);
    lv_label_set_text(ui->screen_ctrl_btn_set_label, "");
    lv_label_set_long_mode(ui->screen_ctrl_btn_set_label, LV_LABEL_LONG_WRAP);
    lv_obj_align(ui->screen_ctrl_btn_set_label, LV_ALIGN_CENTER, 0, 0);
    lv_obj_set_style_pad_all(ui->screen_ctrl_btn_set, 0, LV_STATE_DEFAULT);
    lv_obj_set_width(ui->screen_ctrl_btn_set_label, LV_PCT(100));
    lv_obj_set_pos(ui->screen_ctrl_btn_set, 130, 20);
    lv_obj_set_size(ui->screen_ctrl_btn_set, 90, 90);

    //Write style for screen_ctrl_btn_set, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->screen_ctrl_btn_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_ctrl_btn_set, lv_color_hex(0x444444), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->screen_ctrl_btn_set, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(ui->screen_ctrl_btn_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->screen_ctrl_btn_set, 15, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->screen_ctrl_btn_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_src(ui->screen_ctrl_btn_set, &_sz_90x90, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_opa(ui->screen_ctrl_btn_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_recolor(ui->screen_ctrl_btn_set, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_recolor_opa(ui->screen_ctrl_btn_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->screen_ctrl_btn_set, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->screen_ctrl_btn_set, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->screen_ctrl_btn_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->screen_ctrl_btn_set, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes screen_ctrl_btn_alarm_clock
    ui->screen_ctrl_btn_alarm_clock = lv_btn_create(ui->screen_ctrl);
    ui->screen_ctrl_btn_alarm_clock_label = lv_label_create(ui->screen_ctrl_btn_alarm_clock);
    lv_label_set_text(ui->screen_ctrl_btn_alarm_clock_label, "");
    lv_label_set_long_mode(ui->screen_ctrl_btn_alarm_clock_label, LV_LABEL_LONG_WRAP);
    lv_obj_align(ui->screen_ctrl_btn_alarm_clock_label, LV_ALIGN_CENTER, 0, 0);
    lv_obj_set_style_pad_all(ui->screen_ctrl_btn_alarm_clock, 0, LV_STATE_DEFAULT);
    lv_obj_set_width(ui->screen_ctrl_btn_alarm_clock_label, LV_PCT(100));
    lv_obj_set_pos(ui->screen_ctrl_btn_alarm_clock, 20, 130);
    lv_obj_set_size(ui->screen_ctrl_btn_alarm_clock, 90, 90);

    //Write style for screen_ctrl_btn_alarm_clock, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->screen_ctrl_btn_alarm_clock, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_ctrl_btn_alarm_clock, lv_color_hex(0x444444), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->screen_ctrl_btn_alarm_clock, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(ui->screen_ctrl_btn_alarm_clock, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->screen_ctrl_btn_alarm_clock, 15, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->screen_ctrl_btn_alarm_clock, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_src(ui->screen_ctrl_btn_alarm_clock, &_nz_90x90, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_opa(ui->screen_ctrl_btn_alarm_clock, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_recolor(ui->screen_ctrl_btn_alarm_clock, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_recolor_opa(ui->screen_ctrl_btn_alarm_clock, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->screen_ctrl_btn_alarm_clock, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->screen_ctrl_btn_alarm_clock, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->screen_ctrl_btn_alarm_clock, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->screen_ctrl_btn_alarm_clock, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes screen_ctrl_btn_led
    ui->screen_ctrl_btn_led = lv_btn_create(ui->screen_ctrl);
    ui->screen_ctrl_btn_led_label = lv_label_create(ui->screen_ctrl_btn_led);
    lv_label_set_text(ui->screen_ctrl_btn_led_label, "");
    lv_label_set_long_mode(ui->screen_ctrl_btn_led_label, LV_LABEL_LONG_WRAP);
    lv_obj_align(ui->screen_ctrl_btn_led_label, LV_ALIGN_CENTER, 0, 0);
    lv_obj_set_style_pad_all(ui->screen_ctrl_btn_led, 0, LV_STATE_DEFAULT);
    lv_obj_set_width(ui->screen_ctrl_btn_led_label, LV_PCT(100));
    lv_obj_set_pos(ui->screen_ctrl_btn_led, 130, 130);
    lv_obj_set_size(ui->screen_ctrl_btn_led, 90, 90);

    //Write style for screen_ctrl_btn_led, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->screen_ctrl_btn_led, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_ctrl_btn_led, lv_color_hex(0x444444), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->screen_ctrl_btn_led, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(ui->screen_ctrl_btn_led, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->screen_ctrl_btn_led, 15, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->screen_ctrl_btn_led, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_src(ui->screen_ctrl_btn_led, &_led_90x90, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_opa(ui->screen_ctrl_btn_led, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_recolor(ui->screen_ctrl_btn_led, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_img_recolor_opa(ui->screen_ctrl_btn_led, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->screen_ctrl_btn_led, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->screen_ctrl_btn_led, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->screen_ctrl_btn_led, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->screen_ctrl_btn_led, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes screen_ctrl_btn_1
    ui->screen_ctrl_btn_1 = lv_btn_create(ui->screen_ctrl);
    ui->screen_ctrl_btn_1_label = lv_label_create(ui->screen_ctrl_btn_1);
    lv_label_set_text(ui->screen_ctrl_btn_1_label, "");
    lv_label_set_long_mode(ui->screen_ctrl_btn_1_label, LV_LABEL_LONG_WRAP);
    lv_obj_align(ui->screen_ctrl_btn_1_label, LV_ALIGN_CENTER, 0, 0);
    lv_obj_set_style_pad_all(ui->screen_ctrl_btn_1, 0, LV_STATE_DEFAULT);
    lv_obj_set_width(ui->screen_ctrl_btn_1_label, LV_PCT(100));
    lv_obj_set_pos(ui->screen_ctrl_btn_1, 20, 240);
    lv_obj_set_size(ui->screen_ctrl_btn_1, 90, 90);

    //Write style for screen_ctrl_btn_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->screen_ctrl_btn_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_ctrl_btn_1, lv_color_hex(0x444444), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->screen_ctrl_btn_1, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(ui->screen_ctrl_btn_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->screen_ctrl_btn_1, 15, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->screen_ctrl_btn_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->screen_ctrl_btn_1, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->screen_ctrl_btn_1, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->screen_ctrl_btn_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->screen_ctrl_btn_1, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes screen_ctrl_btn_2
    ui->screen_ctrl_btn_2 = lv_btn_create(ui->screen_ctrl);
    ui->screen_ctrl_btn_2_label = lv_label_create(ui->screen_ctrl_btn_2);
    lv_label_set_text(ui->screen_ctrl_btn_2_label, "");
    lv_label_set_long_mode(ui->screen_ctrl_btn_2_label, LV_LABEL_LONG_WRAP);
    lv_obj_align(ui->screen_ctrl_btn_2_label, LV_ALIGN_CENTER, 0, 0);
    lv_obj_set_style_pad_all(ui->screen_ctrl_btn_2, 0, LV_STATE_DEFAULT);
    lv_obj_set_width(ui->screen_ctrl_btn_2_label, LV_PCT(100));
    lv_obj_set_pos(ui->screen_ctrl_btn_2, 130, 240);
    lv_obj_set_size(ui->screen_ctrl_btn_2, 90, 90);

    //Write style for screen_ctrl_btn_2, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->screen_ctrl_btn_2, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_ctrl_btn_2, lv_color_hex(0x444444), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->screen_ctrl_btn_2, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(ui->screen_ctrl_btn_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->screen_ctrl_btn_2, 15, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->screen_ctrl_btn_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->screen_ctrl_btn_2, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->screen_ctrl_btn_2, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->screen_ctrl_btn_2, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->screen_ctrl_btn_2, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

    //The custom code of screen_ctrl.


    //Update current screen layout.
    lv_obj_update_layout(ui->screen_ctrl);

    //Init events for screen.
    events_init_screen_ctrl(ui);
}
